package cn.mutsuki.micrometer.core;

import io.micrometer.core.instrument.config.MeterFilter;
import java.util.ArrayList;
import java.util.List;

public class MtkMeterRegistryCommonProperties {
    private String[] commonTags;
    private List<MeterFilter> filterList = new ArrayList<>();

    public void setCommonTags(String[] commonTags){
        if(commonTags.length %2 == 1) throw new IllegalArgumentException("commonTags length is not correctly, length: " + commonTags.length);
        this.commonTags = commonTags;
    }

    public String[] getCommonTags(){
        return commonTags;
    }

    public List<MeterFilter> getFilterList(){
        return filterList;
    }

    public MtkMeterRegistryCommonProperties addMeterFilter(MeterFilter meterFilter){
        filterList.add(meterFilter);
        return this;
    }
}
